package es_constants

const (
	EsIndexSystemLog     = "es_system_log_data"
	EsIndexSystemLogV2   = "es_system_log_data_v2"
	EsIndexSystemLogV3   = "es_system_log_data_v3"
	EsIndexOperateRecord = "es_operate_record"
)

var ESIndexDataMap = map[string]string{
	EsIndexSystemLog: `
        {
            "mappings": {
                "properties": {
                    "menu_id": {"type": "long"},
                    "url": {"type": "keyword"},
                    "content": {"type": "keyword"},
                    "user_id": {"type": "long"},
                    "create_time": {"type": "date", "format": "yyyy-MM-dd HH:mm:ss"}
                }
            }
        }
        `,
	EsIndexSystemLogV2: `
        {
            "mappings": {
                "properties": {
                    "menu_id": {"type": "long"},
                    "url": {"type": "keyword"},
                    "content": {"type": "keyword"},
                    "user_id": {"type": "long"},
                    "create_time": {"type": "date"},
                }
            }
        }
        `,
	EsIndexSystemLogV3: `
        {
            "mappings": {
                "properties": {
                    "menu_id": {"type": "long"},
                    "url": {"type": "keyword"},
                    "content": {"type": "keyword"},
                    "user_id": {"type": "long"},
                    "create_time": {"type": "date"},
					"create_time_stamp": {"type": "date", "format": "epoch_millis"}
                }
            }
        }
        `,
	EsIndexOperateRecord: `
    {
	    "mappings": {
	    	"properties": {
	    		"business_type": {
	    			"type": "long"
	    		},
	    		"business_id": {
	    			"type": "long"
	    		},
				"bind_type": {
	    			"type": "long"
	    		},
	    		"bind_id": {
	    			"type": "long"
	    		},
	    		"before_data": {
	    			"type": "keyword"
	    		},
	    		"after_data": {
	    			"type": "keyword"
	    		},
	    		"operate_table": {
	    			"type": "text"
	    		},
	    		"operate_table_id": {
	    			"type": "long"
	    		},
	    		"operate_data_name": {
	    			"type": "keyword"
	    		},
	    		"changed_data": {
	    			"properties": {
	    				"action": {
	    					"type": "keyword"
	    				},
	    				"field_name": {
	    					"type": "keyword"
	    				},
	    				"before_value": {
	    					"type": "keyword"
	    				},
	    				"after_value": {
	    					"type": "keyword"
	    				}
	    			}
	    		},
	    		"operate_type": {
	    			"type": "long"
	    		},
	    		"create_staff_id": {
	    			"type": "long"
	    		},
	    		"create_time": {
	    			"type": "date",
	    			"format": "yyyy-MM-dd HH:mm:ss"
	    		},
	    		"record_type": {
	    			"type": "long"
	    		}
	    	}
	    }
	}
    `,
}
